package com.sso;

import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

/**
 * 
 * @Title:SpringBoot启动Main函数
 * @Description:
 * @Author:吉
 * @Since:2016年4月8日
 * @Version:1.1.0
 */
@Configuration
@ImportResource("classpath:*.xml")
@EnableAutoConfiguration
public class ApplicationSso implements EmbeddedServletContainerCustomizer {

	private static Logger logger = Logger.getLogger(ApplicationSso.class);

	private static final int PORT = 8099;

	public static void main(String[] args) {
		try {
			SpringApplication.run(ApplicationSso.class, args);
		} catch (Exception e) {
			logger.info("工程启动失败！！...");
			logger.error(e.getMessage(), e);
		}
	}

	/**
	 * 设置端口号
	 */
	@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {
		container.setPort(PORT);
	}
}
